package com.company.设计模式.单例模式;

/**
 * @Classname Singleton2
 * @Description 饿汉式 线程安全
 * 直接实例化的方式也丢失了延迟实例化带来的节约资源的好处
 * @Date 2021/9/10 10:32
 * @Created by ylr
 */
public class Singleton2 {
    private static Singleton2 uniqueInstance = new Singleton2();

    private Singleton2(){

    }

    public static Singleton2 getUniqueInstance(){

        return uniqueInstance;

    }



}
